package com.brk.socket.config;

import com.brk.socket.interceptor.LoginIdentityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author brk
 * @date 2023/7/17 14:38
 * @Description:
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    LoginIdentityInterceptor interceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(this.interceptor)
                .addPathPatterns("/user/*").excludePathPatterns("/doc.html#/*", "/doc.html#/**", "/doc.html", "/webjars/**", "/error", "/images/**", "/swagger-resources/**",  "/image/**",
                        "/user/login", "/user/register","/user/sendCode", "/user/changePassword");
    }



}
